/*
 * @Date: 2024-03-19 10:19:27
 * @LastEditors: lyx
 * @LastEditTime: 2024-03-20 09:23:24
 * @FilePath: \taro-template3\src\packageA\components\ChatEcharts\index.tsx
 * @Description: echart 渲染
 */
import React from 'react';
import { View } from '@tarojs/components';
import styles from "./index.module.scss";
import Echarts from "taro-react-echarts";
import { BaseEchartProps } from './type';
import useBaseEchart from './useBaseEchart';
import * as echarts from "echarts";

function ChatEcharts(props: BaseEchartProps) {
  const { option = {}, isPage = true } = props;
  const baseEchartInst = useBaseEchart(props);
  return (
    <View className={styles['chat-echarts-component']}>
      <Echarts
        echarts={echarts}
        option={option}
        ref={baseEchartInst.echartsRef}
        isPage={isPage}
        // force-use-old-canvas="true"
      ></Echarts>
    </View>
  );
}

export default ChatEcharts;
